<?php
/**
 * 阿里大鱼短信发送.
 * User: hdk
 * Date: 2016/8/31
 * Time: 16:26
 */
namespace Alidayu;

class AlidayuSms
{
    /**
     *
     * 发送短信
     * @param $recnum 手机号码
     * @param $templateCode 模板编号
     * @param $param 传递参数
     * @return array|false
     */
    public static function send($recnum,$templateCode,$param){
        $client  = AlidayuClient::getInstance();
        $req = Request\SmsNumSend::getInstance();
        $req->setExtend("123456");
        $req->setSmsType("normal");
        $req->setSmsFreeSignName("传言");
        if($param)$req->setSmsParam($param);
        $req->setRecNum($recnum);
        $req->setSmsTemplateCode($templateCode);
        $resp = $client->execute($req);
        return $resp['alibaba_aliqin_fc_sms_num_send_response']['result'];
    }
}